<?php
namespace App\Query;

use App\Model\Level;

class LevelQuery extends \HyperfStore\Query
{
    // 构建模型
    protected static function build()
    {
        return Level::orderBy('money', 'desc');
    }
    
    // 下一级
    public static function next($money)
    {
        return static::model()->where('money', '<=', $money)->first();
    }
}